﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EntityLayer;
using System.Xml.Serialization;

namespace TestEntity2
{
    [XmlRoot]
    public class Firm:IObject
    {        
        int _ID;
        [XmlAttribute(AttributeName = "Name")]
        public string Name { get; set; }
        [XmlAttribute(AttributeName = "Director")]
        public string Director { get; set; }
        [XmlAttribute(AttributeName = "OpenDate")]
        public DateTime OpenDate { get; set; }
        [XmlAttribute(AttributeName = "Raiting")]
        public int Raiting { get; set; }
        [XmlAttribute(AttributeName = "ID")]
        public int ID
        {
            get;
            set;
        }

        public string Summary
        {
            get { return Name +"-"+ OpenDate.ToShortDateString(); }
        }
        public string ObjectType
        {
            get
            {
                return "Firm";
            }

        }
        //public override string ToString()
        //{
        //    return "<Firm ID=\"" + ID + "\" Name=\"" + Name + "\" Director=\"" + Director + "\" OpenDate=\"" + OpenDate.ToShortDateString() + "\" Raiting=\"" + Raiting + "\" />";
        //}
       
    }
}
